﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SharedGenomics.Workbench.Core
{
    public class ViewMappingStrategy : ITypeMappingStrategy
    {
        public void ExamineType(Type type, IDictionary<Type, Type> mappings)
        {
            //get all view interfaces on the current type (except IView itself)
            foreach (Type interfaceType in type.GetInterfaces().Where(it => typeof(IView).IsAssignableFrom(it) && typeof(IView) != it))
            {
                mappings[interfaceType] = type;
            }
        }
    }
}
